﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace SecurePad
{
    public partial class FormCreatePassword : Form
    {
        public FormCreatePassword()
        {
            InitializeComponent();
            this.txtPassword.Focus();
        }

        private void OkEvent(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtPassword.Text))
            {
                return;
            }

            if (!txtPassword.Text.Equals(txtConfirm.Text))
            {
                return;
            }

            this.DialogResult = DialogResult.OK;
            this.Tag = txtPassword.Text;
            this.Close();
        }

        private void CancelEvent(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Tag = null;
            this.Close();
        }
    }
}
